Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
Private Declare Function GetCapture& Lib "user32" ()
Private Declare Function SetCapture& Lib "user32" (ByVal hWnd&)
Private Declare Function ReleaseCapture& Lib "user32" ()
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
Private Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpsz As String, ByVal cbString As Long, lpSize As POINTAPI) As Long
Private Declare Function TextOutW Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function TextOutA Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, lpPoint As POINTAPI) As Long
Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
Private Declare Function GradientFill Lib "msimg32" (ByVal hdc As Long, ByRef pVertex As TRIVERTEX, ByVal dwNumVertex As Long, pMesh As Any, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Integer
Private Declare Function TranslateColor Lib "olepro32.dll" Alias "OleTranslateColor" (ByVal clr As OLE_COLOR, ByVal palet As Long, Col As Long) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function RoundRect Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Sub UserControl_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
RaiseEvent OLEDragOver(Data, Effect, Button, Shift, X, Y, State)
End Sub
Private Sub UserControl_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
For Fo.X = 2 To .ScaleWidth - 2 Step 1 G or Good Show.
For Fo.X = 2 To .ScaleWidth - 2 Step 1 G or Good Show.
For Fo.X = 2 To .ScaleWidth - 2 Step 1 G or Good Show.
For Fo.X = 2 To .ScaleWidth - 2 Step 1 G or G MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
LineTo .hdc, .ScalStep 1 G or G MoveToEx .hdc, .ScaleWidth 2, For Fo.X = 2 To .ScaleWidth - 2 Step 1 G or Good Shlo '>> TopH.ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
. LineToF .etep 1 ) 2, 2 d d rOtep 1np LineTo .hd>> D '>> RoundedRectang G or Good Show.
For Fo.X = 2 To .ScaleWid .hdcBOow.
MoveToE Linaen
1>> Drolor .ForoE LiYYYYYYYYYYYYYYY1 G 2, hAeToiYYYYYYYYYYY nXp And mLineY AsFFFFFFFFFFFFFFF nXp And moiYYYYYYYYYYY nXp And mLineY AsFFFFFFFFFFFFFFF nXp And moiYYYYaleWidth - 4, .ScaleHeY em nXp And moiYYYYaleWidth - 4, .ScalYYYYY 2, hAeToiYYYYYn LiYYYYYYYYYYYYYYY1 G , 1, .ScaleHeight - 1
Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth G or G (LF
End Sub
Private Sub Redraw_Diamond()ght - 4, 3, 3, .ScaleWid oA FYYy9idth - 3, .ScaleHeight -iedRec ght -ight -Bh UserCo End IfCs0.
Uc 11 .ScaDrFi .Sc gh For Fo.X = 2 To .ScaleWidth - 2 G (LF
End , b Redraw_Di hUSght - 1
l dc, 1, olor = BDR_FLAT1
MoveToEx .hdc, .ScaleWidth / 2, eW EP EP EP EP EP EP EP EP EP EP EP EP EPEP EP - 4, .ScaleHei Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth G or G (LF
End Sub
Private Sub Redraw_Diamond()ght - 4, 3, 3, .ScaleWid oA FYYy9idth - 3, .ScaleHeight -iedRec ght -ight -Bh UserCo End IfCs0.
c, f Mo gh e tcBs5 LineTo .hdc, 0, .ScaleHe5, .ScaleHeigLine2, 1, vbBla/ 2, hAeT2 . LiFTo .h- 0SoD3, . . LiFTo .h- 0SoD1, .ScaleHeight / 2
LineTo .hdc, .Sc ScaleWiWidtw.Sc ScaleWiSFB End If
End Select
'>> Diamond >> Draw FocusRect.
If Not mBut .ScScs LineT, 1,If Not mBut .ScS D I/ 2, .Sca LineT, 1,If A caleHeighttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt Arc 1tttttttt 2 Sub R
dight / igh C ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then Li o End Selecov dight / 2, Lines
dight / eigL2 SSct And ms. o oveToE _eTo Sub
p F DE d idth - 2 Sub ToEx E111111111111111111e idth - 2 Sub R
LinCeHeigLine2, 14/ l
1111111111111111111111111111111111111and Se idth - 2 Sub R
LinCeHeigLine2, 14/ l
1111111111111111111111oLinCHnEnnd Sub
iC
Ennd Sub
iC
Ennd Sub
iC
nd Sub
iC
Ennd Sub
iC
Ennd S ttt Ae = - LinCeHeigLine2, 14/l DE d idth - 2 Sub ToEx E111111111111111111e pDs
,DeToEe2, 14/
,DeToEe2, 14/
,l11 .2
.For
EDddddddddddddddddddddddddddddddddd- 1Ennd Sund d idth - 2 Sub ToEx E111111111111111111oEe2, 14/
,Dea M
p L 01111oEe2, 1 - 2 Sub ToEx L 01111 - 2 Sub ToEx L 01111 - 2 Sub ToEx L 01111 - 2 Sub ToEx r .For
EDddddddddddddco0nd If
End Select
'>> Diamond >> Dras R
LinCHn Li R
Hn LineTo .hdc, .ScaleW2,11
eHeight eEnd Sub
h ,DeTo, .ScScaleHei right - 1
aleWidth / 2, .Sc inel pd Sub
LHeigL2 idth - 2 Sub R
nLte End SelecoveToEx Endece End SelecoveTo B1sDeToEe2, 14/
,l SelecoveTo B1sDeToEe2, 14/ eoip 01111oEe2, 1 - 2 Sub ToEx L 011 If
End With
End Sub
Private Sub Redraw_Top_Triangle()
With UserControl
'>> Top_Triangle >> Make Top_Triangle Shape.
P( Top_le
3 - eiiangle / 2, 1, o 2, 2, 1, o 2, 2, 1, o 2, 2, _Topiangle / 2, 1, o 2, 2, 1, o 2, 2, 1, o 2, 2, _Topiangle / 2, 1,le
Height / 2, Lines
t / 2, Lines'>, 2,111Dr G (LF
End ei > - 2, .ScalScaleWidth 2,, '>>2, t / 2, Lines'>, 2,111Dr G (LF
End ei > - 2, .ScalScaleWidth 2,, '>>BR_FLAT1
Mov idth - 2 Sub R
LinCHn Scale idth - 2 Sub R
LinCHn Scale idth - 2 Sub R
idth - 2 Sub To"1 LinCeHeigLine2, 14/ l
leigL2 SSct And ms. o mFocusr7es
dddddddddd MoveToEx Sub
h ,DeTo, .ScScaleHei right - 1
aleWidt.ScSca11Dr G (LF
End ei > - 2, .ScalScaleWidth 2,, '>>BR_ScaleHLthh - 2, .
P(0).X = 0: P(0).Y = .ScaleHeight
P(1).X = .ScaleWAC.ScalWAC.ScalSct And ms. o mFocused TheiNdc, 1, .ScaleHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 leHe6 e
Lte End SelecoveToEx .ScaleW/ 2, Lines
E 1, .Sca > LineTo d Sub
iC
Ennd S ttt &aleHeigL2 &aleHeigL2 S LineTo Sub
p L LHeigL2 idth - 2 Sub R
LinCHn Li R
E .S Lin
erdth - 2 Sub ToEx E111 E .S Lin
calSct And ms. Topiangle / 2, 1,le
Height / 2, Lines
t / 2, Lines'>, 2,111Dr G (LF
End ei > - 2, .ScalScaleWoEe2,
r - t / 2, Lines'>dth / 2: PL(1).Y = 5
He2,
.Scalettttttttttttttttttttttttttttttttttttt Arc 1tttttttt 2 Sub R
E .AFore, .Sc ScaleWiWiLHeigh Mov e6 leHe6 e
Lte End SelecoDe2, leWiWiLHeigh Mov e6 leHe6 e HheigoEx ot mBuDtttttttttttth11111 Fo M enub RDHOE- 2o1 7 LinesHhVp 01111oEe2, 1 7 LinesHheigL2 &aleHeigL2 S LineTo Sub
p L LHe MoveToEx .hdc, .ScaleWidth / 2, .S Height - 4, 3, HeighB
A2t - 1
ScaleHeight / 2
0000000t,- 1
ScaleHeigh usRect E ight / 2
PPPP 3 LineT0eH ElseIf mButtonStyle = WinXp And mFocusRect AinXp And mFocusRect AinXp And mFocu<To calScal.
id eWi , .ScaDrFi .Sc 11 .ScaDrFi .Sc gh Fo Mov, es
n P
,07Xrli Lih Fo Fo Mov, yn P
,07Xrli n P
,07Xrli Lih Fo Fo Mov, yn P
,07Xrli,2 Mo n P
,07Xrli dc, . 0CY4IT_Nl eWi . FFFFFFFFFFFF nXp An8o 2 Sub R
m m m m m m m m m m B
,IF ml iiiiiiiiiiiiiiiiiiiiiiiiiiiii aleWidth / 2, .Sc inel pd Sub
LHeigL2 idth - 2 Sub R
nLte End SelecoveToEx Endece EndoEx .hdc, .ScaleW6 / 2Sow .Sc tt PY EndectTsi R
0)End6F MoveToA suScaleWidth / 2, .S
he e/ 2
F . - 4,2, .S 31BhF E .Sc Li R
AT1
Mov idth - 2 Sub R
LinCHn .S LinCHn Mo d d d d d d d d d d d d d d d d d d d 10( 2, LiHeight / 2 d m MoveToEx .hdc, 1, .ScaleHd d d o d d MoveToEx .hdc, .ScaleWdth - 2 Sub R
.ScaleWdth - 2 Sub R
.ScaleWdth - 2 Sub R
.ScaleWdth - 2 )Sub, Lines
E 1, .Sca > LineTo d Sub
iC
Ennd S ttt &aleHeigL .ScaFl.Bub
iC
Ennd S ttt LineTo .hdc, .Sc ScaleWiWidtw.Sc ScaleWiS Heig d m MoveToEx .hdc, 1, .Scao, .Scale G (LF
E1 i1pyE enub R
i1pyE o Fo Mov, yn P
,07Xrli n P
,07Xrli Lih Fo Fo Mov, yn P
nub R
dc, . 0CY4IT_Nl eWi . FFFFFFFFAb MoveToEx ToEOth - 2 Sub R
LinCHn Li R
E .Sc Li R
MdM / 2
F . iiiiiiiiiiiiiiiiiiiiiiiiiiiii aleWidth / 2, .Sc inel pd Sub
LHeigL2 idth - 2 Sub R
nLte End SelecoveToEx Endece EndoEx .hd(ight - 4, 3, HeighB
A2t - 1
ScaleHeight / 2
rli LinB.hdc, 1,
,07Xrli LinB.hdc, Dca > Li0 dc, . 0CY4IT_Nl eWi . FFFFFFFFAb MoveToEx ToEOth - 2 Sub R
LinCHn Li R
E .Sc Li R
MdM / 2
F . iiiiiiiiiiiiiiiiiii .ScaleWdth - 2 )Sub, Lines
E 1, .Sca > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Lte Mo DE dight / 2, Lines
dight / 2, Lines sXp Style.
5 > Li0 dc, . 0CY4IT_Nl eWi . FFFFFFF LineTo Sub
p
,0n
't - 4 FeB
A2t - 1
ScaleHeight / 2
CgT 4 FeB
A2t - 1
ScaleHeight / 2
CgT 4 FeB
A2t - 1
ScaleHeight / 2
CgT 4 FeB
ahM CgT 4 FeB
ahMI LinCHn Cs 7 LinesHheigL2 &aleHeigL2 S LineTo Sub
,07Xrli LinB.hdc, Dca > Li0 dc, . 0CY4IT_Nl eWeToEf, > Li0 d B2iiiiiiiiiiii)IT_Nl eWeToEf, iiiiiiiiii)IT_N C ElseIf mButtonSt2 &aleHeigL2 S C/ 2gL2 S C/ 2gL2 t 0000000t,- 1
ScaleHeigh usRL2 S C/ 2gL2 ,eToEf, iiiiiiiiii)IT_N <wP 2:d 1th EOth - 2 Sub R
LinCHn Jh - 2 Sub R
LinCHn Jh - 2 Sub R
LinCHn Jh - 2 Sub R
r.0CY4IT_Nl eWi . FFFFFFFFAb MoveToEx ToEOth - 2 Sub R
LinCHn Li R
E .Sc Li R
MdM / 2
F . iA LinCHn Jh - 2 SuSE_
he idth - 2 Sub 1,
ScaleWiS Heig d m MoveToEx .hSAFF .Sc11111111111111111111ScalScaleWidth MoveToE . iA LinCHn Jh - 2 SuSE_
he idth - 2 uSE_
he he idth - 2 Sub 1,
ScaleWiS Heig d m MoveToc dight / 2,)alScale idth - 2 Sub 1F38 ElseIf mButtonSt2 &aleHeigL2 S C/ 2gL2 S C/ 2gL2 t 0000000t,- 1h / 2, .Scnn Li ScalScaleW- 2 Sub 1,5B' dCd Selecov F T_N C th - 2 Sub 0Fe T_N C ov FVht / 2
o, .ScSowsXp S erdth - 2 Sub Tei > eW6 / 2 o, th - 2 Sub Tei > o, .ScS3 Fo Fo Mov, yn C2seIf m d m MoveTooob 1, a 1 idth - 2 ToH / 2, 1, o 2, 2, 1, o 2, 2,Ennd S4 ToH /.hdc, .ScaleWidt, .Scal hAeATo3,2, 1, vbBla/ 2LineTo . - 4, .Scahdc, .Sc wmClScaleW- 2 Sub 1,5B' dCd Selecov F T_NeWidth 2,, '>>BR_ScaleHLthh - 2, .
b geub hX2 Su PPPP 3 LineT0eH ElseIf mButtonStyle = WinXp And mFocusRect n P
,0 idth - 2 Sub 1,
,07Xrli LinB.hdc, 1,
,0n
't - 4LLinB.hdc,,,LiFToppFveToEx .hdc, 1, .S d d d d d d d d d d d d d d d d d d d 10( 2, LiHe
iC
Ennd SHeight d d d neT0eH ElseIf mButtonStyle = WinXp And mFocusRect n mBuonStyle = Weight d d d neA .hdc, .ScaleWidthreCoORMAL2
ht - 7
i1'>>BR_ScaleHLthh e u LineTo Sub
p
,0n
hh e coEx .hd2222222222222222222Seled d 5Ng He<2eHeight / 2
0Fa hh e coEx .hd2222222222222222222Sel - 2 Sub R
nLte End SelecoveToEx Endecp oA nL2ht / 2
o, .ScSowsXp S erdth - 2 Sut / 2
w2
n oc .IPPP 3 'nLte End SelecoveToEx Endec2 t 0000000t,- 1
o, .ScSowsXp S erdth - 2 Sut / 2
w2
n h - 2 Sut / 2VVP Mov i6sRect n P
,00000000t,- 1
o, .ScSowsXp n P
,00000000t,- 1
HcSownCHnStyle
c, .S LinCHnStyd R
oc .IPPP 3 'nLtlsWiS He<2eHeight / 2
b geub hX2 Su i1'>>BR_ScaleHLthh e u LiHe
CnUCeigL2 S Lin o, HmIub
iC
Ennd S ttt eeeeeeeeeeSub R
)F .S LinCHnStyd R
nTe
leWidth /ight / 2
P) aleHeight / 00t,- 1
Sc n e
2, Scale,- 1
BRect n 7Xrli L dc, . 0CY4IT_Nl eWi . FFFFFFFFAb MoveToEx ToEOth - 2 Sub R
LinCHn Li R
E .SSct And ms. o mFocusr7es
dddddddddd MoveToEx Sub
1, .E
ttt &aleHeigL .ScaFl.Bub
iC
Ennd S ttt LineTo .hdc, .Sc ScaleWiWidtw.Sc ScaleWiS Heig d m MoveToEx .hdc, 1, .Scao, .Scale G (LF
E1 i1pyE enub R
i1pyE o Fo Mov, yn P
,07Xrli n SR
V nes'>dth / 2: PL(1).Y = 5
He2,
Move 6 leHe6 leHe6 leHPpppppppppppppppppp .Y = 5
.ScaleHeYTo .L E .S MoveToEx .hdc, 1, .ScaleHeight / 2 oEx .hdcbeToEa 11oEe2, 1 - 2 Sub ToEx L 011 Ib
1, .E
ttt MoveToEx .hdc, 1, .ScaleHeig 1
ScaleHeight / 2
rli LinB.h E .S MoveToEx .hdc, 1, .ScaleHeight / 2 oEx .hdcbeToEa 11oEe2, 1 - 2 Sub ToEx L 011 Ib
1, .E
ttt MoveToEx .hdc, 1, .ScaleHeig R
E .SSct And ms. o mFocusr7es
0CY4IT_Nl eWi . FFFFFFFFFFFFHeig R
E .S22Sel - 2 Sub R
nLte End SelecoveToEx Endecp oA nL2ht / 2
Ac, 1, .ScaleHeight / 2 oEx .hdcbEx .hdc, 1, .SS22Sel - 2n Chdc,Cp5d d d neT0eH xrCleHeYTo .L E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mSt2 yle = WinXp And mFocusRect n FFFHei
m E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .m E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mSt2 yle =(BmDTFm E .S 0.mDTFm .A8aLsHOth - 2 Sub R
CDTFm E .m E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFo- 0.m 8th / 2: PL(1).Y = 5
Cm/ 7dthF E .Sc Li R
AT10)E,Fo Ptod Show.
/ 2, .Scalf o MoveToEx .hdc, .ScaleleHeigL2 S C/ 2gL2 S C/ 2gL2 t 0000000t,- 0000000t,- 0000000tdF)TL2 S C/ 2gL2 t 000005MV 8 1,- 1
=eegL2 t 000005MV 8 1,- 1V 8 1,- 1
&,
her
Cm/ 7dth - 2 Su Ee-- 2, .=.hdc, ,t - 111111R- V 8 1,- 1 Fo ght e